
# 最原始的统计方法
words = [
    'look', 'into', 'my', 'eyes', 'look', 'into', 'my', 'eyes',
    'the', 'eyes', 'the', 'eyes', 'the', 'eyes', 'not', 'around', 'the',
    'eyes', "don't", 'look', 'around', 'the', 'eyes', 'look', 'into',
    'my', 'eyes', "you're", 'under'
]
m = set(words)

def nn():
    for i in m:
        m1 = {}
        n = 0
        for j in words:
            if i == j:
                n += 1
        yield i,n
        m1[i]=n

if __name__ == '__main__':
    l = dict((nn()))
    l1 =sorted(zip(l.values(),l.keys()))
    print(l1[-3:])



# collections的counter法
from collections import Counter
word_counts = Counter(words).most_common(111)   # 数量最多的前三
print(word_counts)